#include "win/widget_root.h"
#include "util/string.h"


namespace win 
{
    BOOL WidgetRoot::ParseXml(const wchar_t* file)
    {
        if (util::String::IsEmpty<wchar_t>(file))
        {
            return false;
        }

        Builder* builder = GetBuilder();
        if (!builder)
        {
            return false;
        }
        body_ = static_cast<core::StContainer*>(builder->Parse(file));
        active_ = 0;
        return body_ != 0;
    }

    Builder* WidgetRoot::GetBuilder()
    {
        return new Builder(&style_cache_);
    }
}